( function(j) {
	var m = function() {
		var e = function(a, c) {
			return new e.core.init(a, c)
		};
		e.dl = [];
		e.ol = [];
		e.dlfun = [];
		e.olfun = [];
		e.core = e.prototype = {
			length : 0,
			object : null,
			context : document,
			init : function(a, c) {
				var b, d;
				if (!a)
					return this;
				if (a.nodeType) {
					this.length = 1;
					this.object = this[0] = this.context = a;
					return this
				}
				if (a === j) {
					this.context = this[0] = j;
					this.object = a;
					this.length = 1;
					return this
				}
				if (a === "body" && document.body) {
					this.context = this[0] = document.body;
					this.object = a;
					this.length = 1;
					return this
				}
				if (typeof a === "string") {
					a = e.trim(a);
					if (c)
						this.context = c;
					if (document.querySelectorAll)
						try {
							d = this.context.querySelectorAll(a);
							this.length = d.length;
							this.object = a;
							for (f = 0; f < d.length; f++)
								this[f] = d[f];
							if (a.indexOf(",") == -1 && a.indexOf(" ") == -1
									&& a.indexOf(".") == -1
									&& a.charAt(0) === "#" && d.length == 1)
								this.context = this[0] = d[0]
						} catch (g) {
							this.length = 0;
							this.object = a;
							this.err = g
						}
					else {
						for (; a.indexOf(", ") != -1;)
							a = a.replace(", ", ",");
						for (; a.indexOf(" ,") != -1;)
							a = a.replace(" ,", ",");
						if (a.indexOf(" ") == -1) {
							if (a.indexOf(",") != -1) {
								d = [];
								b = a.split(",");
								for ( var f = 0; f < b.length; f++)
									for ( var i = e(b[f], this.context), h = 0; h < i.length; h++)
										d[d.length] = i[h]
							} else if (a.charAt(0) === "#") {
								b = [ a.charAt(0), a.substring(1, a.length) ];
								d = document.getElementById(b[1]);
								this.object = a;
								if (d) {
									this.length = 1;
									this.context = this[0] = d
								}
								return this
							} else if (a.charAt(0) === ".") {
								b = [ a.charAt(0), a.substring(1, a.length) ];
								for (d = []; b[1].indexOf(".") != -1;)
									b[1] = b[1].replace(".", " ");
								this.context = this.context == document ? document.body
										: this.context;
								e.findNodes(this.context, b[1], d)
							} else if (a.indexOf(".") == -1)
								d = this.context.getElementsByTagName(a);
							else {
								b = a.split(".");
								i = this.context.getElementsByTagName(b[0]);
								cssName = "";
								for (f = 1; f < b.length; f++)
									if (cssName == "")
										cssName = b[f];
									else
										cssName += " " + b[f];
								d = [];
								for (f = 0; f < i.length; f++)
									if (i[f].className)
										if (e(i[f]).hasClass(cssName))
											d[d.length] = i[f]
							}
							this.length = d.length;
							this.object = a;
							for (f = 0; f < d.length; f++)
								this[f] = d[f]
						} else {
							b = a.split(" ");
							d = [];
							h = [];
							i = e(b[0], c);
							for (f = 1; f < b.length; f++) {
								d = [];
								for (h = 0; h < i.length; h++)
									d[h] = i[h];
								i = [];
								for ( var k = 0; k < d.length; k++) {
									h = e(b[f], d[k]);
									for ( var l = 0; l < h.length; l++)
										i[i.length] = h[l]
								}
							}
							this.length = i.length;
							this.object = a;
							for (f = 0; f < i.length; f++)
								this[f] = i[f]
						}
					}
				}
				return this
			},
			className : function(a) {
				for ( var c = 0; c < this.length; c++)
					this[c].className = a
			},
			_preFormCallBack : function(a, c, b) {
				var d = a;
				if (typeof a == "function")
					d = a.call(c, b);
				return d
			},
			hasClass : function(a) {
				var c;
				for (c = 0; c < this.length; c++)
					if (a == null)
						return this[c].className;
					else if (this[c].className != null) {
						c = " " + this[c].className + " ";
						return RegExp(" " + a + " ", "gi").test(c)
					}
			},
			addClass : function(a) {
				for ( var c, b = 0; b < this.length; b++) {
					c = e.trim(this._preFormCallBack(a, this[b], b));
					c = c.split(" ");
					for ( var d = 0; d < c.length; d++)
						if (!e(this[b]).hasClass(c[d]))
							if (this[b].className)
								this[b].className += " " + c[d];
							else
								this[b].className = c[d]
				}
				return this
			},
			removeClass : function(a) {
				for ( var c, b = 0; b < this.length; b++) {
					c = e.trim(this._preFormCallBack(a, this[b], b)).split(" ");
					for ( var d = 0; d < c.length; d++)
						if (e(this[b]).hasClass(c[d]))
							this[b].className = (" " + this[b].className + " ")
									.replace(RegExp(" " + c[d] + " ", "gi"),
											" ");
					this[b].className = e.trim(this[b].className)
				}
				return this
			},
			innerHTML : function(a) {
				for ( var c = 0; c < this.length; c++)
					this[c].innerHTML = a
			},
			bind : function(a, c) {
				for ( var b = 0; b < this.length; b++)
					if (this[b].addEventListener)
						this[b].addEventListener(a, c, false);
					else if (this[b].attachEvent) {
						var d = function(g) {
							return function() {
								c.call(g)
							}
						}(this[b]);
						this[b].attachEvent("on" + a, d)
					} else
						this[b]["on" + a] = c
			},
			coord : function() {
				var a = {};
				if (this.length > 0) {
					var c = this[0];
					a = {
						height : parseInt(c.clientHeight),
						width : parseInt(c.clientWidth),
						top : 0,
						left : 0
					};
					do {
						a.top += c.offsetTop || 0;
						a.left += c.offsetLeft || 0;
						c = c.offsetParent
					} while (c)
				}
				return a
			},
			splice : [].splice
		};
		e.core.init.prototype = e.core;
		e.trim = function(a) {
			return a.replace(/(^\s*)|(\s*$)/g, "")
		};
		e.isCore = function(a) {
			var c = navigator.userAgent.toLowerCase(), b = null;
			if (j.ActiveXObject)
				b = "ie" + c.match(/msie ([\d.]+)/)[1];
			else if (j.MessageEvent && !document.getBoxObjectFor)
				if (c.indexOf("chrome") != -1)
					b = "chrome" + c.match(/chrome\/([\d.]+)/)[1];
				else if (c.indexOf("firefox") != -1)
					b = "firefox" + c.match(/firefox\/([\d.]+)/)[1];
				else if (c.indexOf("opera") != -1)
					b = "opera" + c.match(/opera\/([\d.]+)/)[1];
				else if (c.indexOf("version") != -1)
					b = "safari" + c.match(/version\/([\d.]+)/)[1];
			a || (a = "ie");
			return b != null && b.indexOf(a.toLocaleLowerCase()) != -1 ? true
					: false
		};
		e.findNodes = function(a, c, b) {
			for ( var d = 0; d < a.children.length; d++) {
				if (c) {
					if (a.children[d].className)
						if (e(a.children[d]).hasClass(c))
							b[b.length] = a.children[d]
				} else
					b[b.length] = a.children[d];
				a.children[d].children.length > 0
						&& e.findNodes(a.children[d], c, b)
			}
		};
		e.dom = function(a, c) {
			var b = e(a, c);
			return b.length > 0 ? b[0] : b
		};
		e.on = function(a, c, b) {
			e(b).bind(a, c)
		};
		e.jsonAjax = function(a, c) {
			for ( var b = e("script"), d = 0; d < b.length; d++)
				if (b[d].src == a) {
					c && c();
					return
				}
			b = document.createElement("script");
			b.type = "text/javascript";
			b.language = "javascript";
			b.src = a;
			if (c)
				if (e.isCore())
					b.onreadystatechange = function() {
						c()
					};
				else
					b.onload = c;
			document.getElementsByTagName("head")[0].appendChild(b)
		};
		e.ajax = function(a) {
			function c() {
				if (b.readyState == 4 && b.status == 200)
					if (d === "json")
						f && f(eval("(" + b.responseText + ")"));
					else
						f && f(b.responseText);
				else
					i && i()
			}
			var b = j.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP")
					: new XMLHttpRequest, d = a.type ? a.type : "string", g = a.openType ? a.openType
					: "get", f = a.fn, i = a.err, h = a.url;
			if (g === "get") {
				var k = h.indexOf("?") < 0;
				if (!a.cache || a.data !== "")
					h = k ? h + "?" : h;
				if (a.data !== "")
					h = k ? h + a.data : h + "&" + a.data;
				a.cache
						|| (h = a.data !== "" || !k ? h + "&iid="
								+ Math.random() : h + "iid=" + Math.random());
				b.open(g, h, true);
				b.onreadystatechange = c;
				b.send(null)
			} else if (g === "post") {
				b.open(g, h, true);
				b.onreadystatechange = c;
				b.send(a.data)
			}
			return b
		};
		e.getEvent = function(a) {
			return a ? a : j.event
		};
		e.getTarget = function(a) {
			a = this.getEvent(a);
			return a.target || a.srcElement
		};
		e.preventDefault = function(a) {
			a = fish.getEvent(a);
			if (a.preventDefault)
				a.preventDefault();
			else
				a.returnValue = false
		};
		e.dlloading = function() {
			if (e.isCore())
				if (document.readyState == "complete")
					if (e.dl.length > 0) {
						e.dl[0][1] && e.dlfun.push(e.dl[0][1]);
						e.jsonAjax(e.dl[0][0], e.dlloading);
						e.dl.splice(0, 1)
					} else
						for (a = 0; a < e.dlfun.length; a++)
							e.dlfun[a]();
				else
					setTimeout(e.dlloading, 100);
			else if (document.readyState == "loaded"
					|| document.readyState == "interactive"
					|| document.readyState == "complete")
				if (e.dl.length > 0) {
					e.dl[0][1] && e.dlfun.push(e.dl[0][1]);
					e.jsonAjax(e.dl[0][0], e.dlloading);
					e.dl.splice(0, 1)
				} else
					for ( var a = 0; a < e.dlfun.length; a++)
						e.dlfun[a]();
			else
				setTimeout(e.dlloading, 0)
		};
		e.olloading = function() {
			if (e.ol.length > 0) {
				e.ol[0][1] && e.olfun.push(e.ol[0][1]);
				e.jsonAjax(e.ol[0][0], e.olloading);
				e.ol.splice(0, 1)
			} else
				for ( var a = 0; a < e.olfun.length; a++)
					e.olfun[a]()
		};
		e.validaClick = function(a, c) {
			var b = e.dom(c[0]);
			if (b.length != 0)
				if (b && b.style.display != "none") {
					for ( var d = [], g = 0; g < c.length; g++)
						for ( var f = e(c[g]), i = 0; i < f.length; i++)
							d[d.length] = f[i];
					f = [];
					for (g = 0; g < d.length; g++)
						e.findNodes(d[g], null, f);
					for (g = 0; g < d.length; g++)
						f[f.length] = d[g];
					d = e.getTarget(e.getEvent(a));
					for (g = 0; g < f.length; g++)
						if (d == f[g])
							return;
					b.style.display = "none"
				}
		};
		e.show = function(a, c) {
			var b = e(a);
			if (b.length > 0) {
				for ( var d = 0; d < b.length; d++)
					if (e.isCore())
						if (c) {
							if (c >= 100)
								return;
							c += 15;
							b[d].style.filter = "alpha(opacity=" + c + ")"
						} else {
							c = 10;
							b[d].style.filter = "alpha(opacity=" + c + ")";
							b[d].style.display = "block"
						}
					else if (c) {
						if (c >= 1)
							return;
						c += 0.05;
						b[d].style.opacity = c
					} else {
						c = 0.025;
						b[d].style.opacity = c;
						b[d].style.display = "block"
					}
				setTimeout("_$.show('" + a + "'," + c + ")", 10)
			}
		};
		e.colorbox = function(a) {
			var c = e(a.content);
			if (c.length > 0) {
				var b = e("#APIBOXCOVER"), d = e("#APIBOXCONTENT");
				if (b.length == 0) {
					b = document.createElement("div");
					b.id = "APIBOXCOVER";
					b.style.display = "block";
					b.style.background = "#000";
					b.style.zIndex = "99999";
					b.style.top = "0";
					b.style.left = "0";
					d = document.createElement("div");
					d.id = "APIBOXCONTENT";
					d.style.position = "absolute";
					d.style.zIndex = "100000";
					if (e.isCore()) {
						b.style.position = "absolute";
						var g = document.body.clientHeight > document.documentElement.clientHeight ? document.body.clientHeight + 30
								: document.documentElement.clientHeight;
						b.style.width = document.documentElement.clientWidth
								+ "px";
						b.style.height = g + "px";
						b.style.filter = "alpha(opacity=30)";
						d.style.filter = "alpha(opacity=0)"
					} else {
						b.style.position = "fixed";
						b.style.width = "100%";
						b.style.height = "100%";
						b.style.opacity = "0.3";
						d.style.opacity = "0"
					}
					document.body.appendChild(b);
					document.body.appendChild(d)
				} else {
					b[0].style.display = "block";
					d = d[0];
					d.style.display = "block"
				}
				if (d.children.length > 0)
					for (b = 0; b < d.children.length; b++)
						d.children[b].style.display = "none";
				if (e.isCore()) {
					g = e("select");
					for (b = 0; b < g.length; b++)
						g[b].style.visibility = "hidden"
				}
				c[0].style.display = "block";
				d.appendChild(c[0]);
				if (a.move == 1)
					e.load(null, a.move);
				else {
					c = e(c[0]).coord();
					d.style.height = c.height + "px";
					d.style.width = c.width + "px";
					e.load("self", a.move)
				}
			}
		};
		e.load = function(a, c) {
			var b = e.dom("#APIBOXCONTENT");
			if (a == "self") {
				var d = e(b).coord();
				if (d.width == 0 || d.height == 0)
					setTimeout("_$.load(" + a + "," + c + ")", 1);
				else {
					var g = 0;
					g = document.documentElement
							&& document.documentElement.scrollTop ? document.documentElement.scrollTop
							: document.body.scrollTop;
					b.style.top = (document.documentElement.clientHeight - d.height)
							/ 2 + g + "px";
					b.style.left = (document.documentElement.clientWidth - d.width)
							/ 2 + "px";
					if (c == 0)
						if (e.isCore())
							b.style.filter = "alpha(opacity=100)";
						else
							b.style.opacity = "1";
					else if (c == 1) {
						if (b.children.length > 0) {
							g = e(b.children[b.children.length - 1]).coord();
							if (d.height >= g.height && d.width >= g.width) {
								b.style.height = g.height + "px";
								b.style.width = g.width + "px"
							} else {
								if (d.height < g.height) {
									var f = g.height - d.height;
									if (f / 9 < 1)
										f = 1;
									else
										f /= 9;
									b.style.height = d.height + f + "px"
								} else
									b.style.height = g.height + "px";
								if (d.width < g.width) {
									f = g.width - d.width;
									if (f / 9 < 1)
										f = 1;
									else
										f /= 9;
									b.style.width = d.width + f + "px"
								} else
									b.style.width = g.width + "px";
								setTimeout("_$.load('self', 1)", 10)
							}
						}
					} else
						e.show("#APIBOXCONTENT")
				}
			} else {
				b.style.overflow = "hidden";
				b.style.height = "1px";
				b.style.width = "1px";
				if (e.isCore())
					b.style.filter = "alpha(opacity=100)";
				else
					b.style.opacity = "1";
				e.load("self", 1)
			}
		};
		e.close = function() {
			if (e.isCore())
				for ( var a = e("select"), c = 0; c < a.length; c++)
					a[c].style.visibility = "inherit";
			e.dom("#APIBOXCOVER").style.display = "none";
			e.dom("#APIBOXCONTENT").style.display = "none"
		};
		e.validaEmail = function(a) {
			return /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,6})+$/
					.test(a) ? true : false
		};
		e.validaPhone = function(a) {
			if (isNaN(a))
				return false;
			else if (a.length == 11) {
				a = a.substring(0, 2);
				return a == "13" || a == "14" || a == "15" || a == "18" ? true
						: false
			} else
				return false
		};
		e.cookie = {
			set : function(a) {
				if (a.value != null) {
					var c = new Date;
					a.days = a.days || 7;
					c.setDate(c.getDate() + a.days);
					var b = a.value;
					if (a.encode != false)
						b = encodeURIComponent(a.value);
					c = a.name + "=" + b + "; expires=" + c.toGMTString();
					if (a.path)
						c += ";path=" + a.path;
					if (a.domain)
						c += ";domain=" + a.domain;
					document.cookie = c
				}
			},
			get : function(a, c) {
				if (document.cookie.length) {
					var b = document.cookie.indexOf(a + "="), d = null;
					d = 0;
					if (b !== -1) {
						b = b + a.length + 1;
						d = document.cookie.indexOf(";", b);
						if (d === -1)
							d = document.cookie.length;
						b = document.cookie.substring(b, d).replace(/[+]/g,
								"%20");
						d = decodeURIComponent(b);
						if (c && d.indexOf("=") != -1) {
							d = d.split("&");
							for (b = 0; b < d.length; b++)
								if (d[b].indexOf("=") != -1
										&& d[b].split("=")[0] == c)
									return d[b].split("=")[1];
							return null
						}
						return d
					}
				}
			}
		};
		return e
	}();
	j._$ = j.fish = m
})(window);
if (window.dl && window.dl.length > 0) {
	_$.dl = dl;
	_$.dlloading()
}
if (window.ol && window.ol.length > 0) {
	_$.ol = ol;
	_$.on("load", _$.olloading, window)
};
